define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'bot/list/index',
        add_url: 'bot/list/add',
        edit_url: 'bot/list/edit',
        delete_url: 'bot/list/delete',
        export_url: 'bot/list/export',
        modify_url: 'bot/list/modify',
        
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'ID',search: false},
                    {field: 'name', title: '工作群',search: false},
                    {field: 'status', title: '状态', templet: ea.table.switch,search: false},
                    {field: 'beizhu', title: '备注',search: false},
                    {
                        width: 250,
                        title: '操作',
                        templet: ea.table.tool,
                        operat: [
                            [{
                                text: '词库',
                                url: 'bot/text/index',
                                method: 'open',
                                auth: 'stock',
                                class: 'layui-btn layui-btn-xs layui-btn-normal',
                                extend: 'data-full="true"',
                            },{
                                text: '日志',
                                url: 'bot/log/index',
                                method: 'open',
                                auth: 'stock',
                                class: 'layui-btn layui-btn-xs layui-btn-normal',
                                extend: 'data-full="true"',
                            }],
                            'edit',
                            'delete']
                    }
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});